﻿using ExcelUnity.Importer.Results;
using Newtonsoft.Json;
using Xunit.Abstractions;

namespace ExcelUnity.Test
{
    public static class OutPutHelper
    {
        public static void WriteImportResult(this ITestOutputHelper output, ImportResult result, object dataModels)
        {
            output.WriteLine($"success:{result.ImportSuccess}");
            output.WriteLine($"summaryErrorMsg-----{Environment.NewLine}{result.SummaryError}");
            output.WriteLine($"notDisplayMsg-----{Environment.NewLine}{result.NotDisplayError}");
            output.WriteLine(
                $"dataModels-----{Environment.NewLine}{(dataModels == null ? null : JsonConvert.SerializeObject(dataModels))}");
        }
    }
}